package net.sunofbeach.blog.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author bing_  @create 2021/11/24-11:15
 */
public class TextUtils {

    /**
     * 检查邮箱地址正则a
     */
    public static final String regEx = "^[a-zA-Z0-9_!#$%&'*+/=?`{|}~^.-]+@[a-zA-Z0-9.-]+$";

    public static boolean isEmailAddressOk(String emailAddress){
        Pattern p = Pattern.compile(regEx);
        Matcher m = p.matcher(emailAddress);
        return m.matches();
    }

    /**
     * 作非空判断
     * @param text
     * @return
     */
    public static boolean isEmpty(String text){
        return text == null || text.length() == 0;
    }

}
